<?php

namespace SpecialOperations\GameBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use SpecialOperations\GameBundle\Entity\Terrain;
use Doctrine\Common\Persistence\ObjectManager;

class LoadTerrains implements FixtureInterface
{
    public function load(ObjectManager $manager)
    {
        $terrains=array('Góry'=>array('speed'=>0.7),
            'Równiny'=>array('speed'=>1),
            'Zabudowania'=>array('speed'=>0.9),
            'Pustynie'=>array('speed'=>0.7),
            'Rzeki'=>array('speed'=>0.8),
            'Lasy'=>array('speed'=>0.8),
            'Bagna'=>array('speed'=>0.5));
        
        foreach($terrains as $name => $values){
            $terrain=new Terrain();
            $terrain->setName($name);
            $terrain->setMovementSpeed($values['speed']);
            
            $manager->persist($terrain);
        }
        $manager->flush();
        
    }
}